package org.giovanolli.mumi.entities;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * The Class PatientLog.
 */
@Entity
@Table(name = "patient_log")
public class PatientLog extends IdentificableEntity {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -2900729799977440943L;

	/** The date. */
	@Column(name = "date")
	private Date date;

	/** The patient. */
	@ManyToOne
	@JoinColumn(name = "patient_id")
	private Patient patient;

	/** The specialist. */
	@ManyToOne
	@JoinColumn(name = "specialist_id")
	private Specialist specialist;

	/** The log. */
	@Column(name = "log", length = 100000)
	private String log;

	/** The observation. */
	@OneToMany(cascade = CascadeType.ALL)
	private List<GeneralObservation> observations = new ArrayList<GeneralObservation>();

	/**
	 * Gets the date.
	 * 
	 * @return the date
	 */
	public Date getDate() {
		return date;
	}

	/**
	 * Gets the log.
	 * 
	 * @return the log
	 */
	public String getLog() {
		return log;
	}

	/**
	 * Gets the observations.
	 * 
	 * @return the observations
	 */
	public List<GeneralObservation> getObservations() {
		return observations;
	}

	/**
	 * Gets the patient.
	 * 
	 * @return the patient
	 */
	public Patient getPatient() {
		return patient;
	}

	/**
	 * Gets the specialist.
	 * 
	 * @return the specialist
	 */
	public Specialist getSpecialist() {
		return specialist;
	}

	/**
	 * Sets the date.
	 * 
	 * @param date
	 *            the new date
	 */
	public void setDate(Date date) {
		this.date = date;
	}

	/**
	 * Sets the log.
	 * 
	 * @param log
	 *            the new log
	 */
	public void setLog(String log) {
		this.log = log;
	}

	/**
	 * Sets the observations.
	 * 
	 * @param observations
	 *            the new observations
	 */
	public void setObservations(List<GeneralObservation> observations) {
		this.observations = observations;
	}

	/**
	 * Sets the patient.
	 * 
	 * @param patient
	 *            the new patient
	 */
	public void setPatient(Patient patient) {
		this.patient = patient;
	}

	/**
	 * Sets the specialist.
	 * 
	 * @param specialist
	 *            the new specialist
	 */
	public void setSpecialist(Specialist specialist) {
		this.specialist = specialist;
	}

}
